package com.deep.deepenterpise.common.code;

import lombok.Getter;

/**
 * 2024/4/16 11:34
 * 状态码
 *
 * @author xyz
 */
@Getter
public enum DrCodeMsg {
    SUCCESS_TRUE(200, "success"),
    SUCCESS_FALSE(500, "failure"),

    AUTH_ERR(500, "认证失败，请重新登录"),
    TOKEN_ERR(500, "token错误，请重新登录"),
    TOKEN_EXPIRE_ERR(501, "token失效，请重新登录"),
    PAGE_ERR(500, "请输入正确的页码"),
    VALID_ERR(500, "请输入正确的参数"),

    SYSTEM_BUSY_ERR(500, "系统繁忙，请稍后再试"),

    ILLEGAL_REQUEST_ERR(500, "非法调用！！！"),

    ;
    private final int code;
    private final String msg;


    DrCodeMsg(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public boolean compare(Integer drCode) {
        return this.code == drCode;
    }

    public boolean compare(DrCodeMsg drCodeMsg) {
        return this.code == drCodeMsg.code;
    }
}
